<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- 设置视口 -->
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- MUI框架 CSS -->
    <link rel="stylesheet" href="lib/mui/css/mui.css">
    <!-- 字体图标库 -->
    <link rel="stylesheet" href="lib/fontAwesome/css/font-awesome.min.css">
    <!-- swiper插件 CSS -->
    <link rel="stylesheet" href="lib/swiper/css/swiper.min.css">
    <!-- 项目CSS -->
    <link rel="stylesheet" href="less/detail.css">
    <!-- 页面标题logo -->
    <link rel="SHORTCUT ICON" href="favicon.ico">
    <title>乐淘商品详情</title>
</head>

<body>

    <!-- 头部区域 -->
    <header id="header">
        <div class="left">
            <a href="search.html" class="fa fa-chevron-left"></a>
        </div>

        <div class="center">
            <h4>乐淘商品详情</h4>
        </div>

        <div class="right">
            <a class="fa fa-home" href="./index.html"></a>
        </div>
    </header>

    <!-- 主体区域 -->
    <main id="main">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <!--这里放置真实显示的DOM内容-->
                <section id="detail"></section>

            </div>
        </div>
    </main>

    <!-- 尾部区域 -->
    <footer id="footer">
        <div class="mui-row">
            <div class="mui-col-xs-2">
                <a href="cart.html">
                    <i class="fa fa-shopping-cart"></i>
                </a>
            </div>
            <div class="mui-col-xs-5">
                <button type="button" class="mui-btn mui-btn-danger add-cart">加入购物车</button>
            </div>
            <div class="mui-col-xs-5">
                <button type="button" class="mui-btn mui-btn-warning">立即购买</button>
            </div>
        </div>
    </footer>

    <!-- MUI框架 JS -->
    <script src="lib/mui/js/mui.js"></script>
    <!-- zepto框架 JS -->
    <script src="lib/zepto/zepto.min.js"></script>
    <!-- 模板引擎 -->
    <script src="lib/artTemplate/template-web.js"></script>
    <!-- swiper插件 JS -->
    <script src="lib/swiper/js/swiper.min.js"></script>
    <!-- 公共js -->
    <script src="js/comment.js"></script>
    <!-- 项目JS -->
    <script src="js/detail.js"></script>
    

    <!-- 模板 -->
    <script type="text/html" id="detailTpl">
        <!-- 轮播图区域 -->
        <section id="slide">
            <!-- mui的轮播图容器 -->
            <div class="mui-slider">
                <!-- 轮播图图片容器 如果需要循环也得设置循环 类名 mui-slider-loop-->
                <div class="mui-slider-group mui-slider-loop">
                    <!-- MUI的轮播图不是很完善需要无缝轮播图需要手动添加重复节点第一张是最后一张
                        最后一张是第一张 而且多一个重复类名 mui-slider-item-duplicate -->
                    <!--支持循环，需要重复图片节点-->
                    <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img
                                src="{{ pic[pic.length-1].picAddr }}" /></a></div>
                    {{ each pic value i}}
                        <div class="mui-slider-item"><a href="#"><img src="{{ value.picAddr }}" /></a></div>
                    {{ /each }}
                    <!--支持循环，需要重复图片节点-->
                    <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img
                                src="{{ pic[0].picAddr }}" /></a></div>
                </div>
                <!-- 小圆点 放到slider group旁边 -->
                <div class="mui-slider-indicator">
                    {{ each pic value i}}
                    <div class="mui-indicator {{ i == 0 ? 'mui-active' : '' }}"></div>
                    {{ /each}}
                </div>
            </div>
        </section>
        <section id="detail-list">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell product-name">
                    名称: <strong>
                        {{ proName }}
                    </strong>
                </li>
                <li class="mui-table-view-cell product-price">
                    价格: <span>${{ price }}</span>&nbsp;<del>${{ oldPrice }}</del>
                </li>
                <li class="mui-table-view-cell product-size">
                    尺码: <span>
                        {{ each size value i }}
                        <button type="button" data-size="{{ value }}" class="mui-btn {{ i == 0 ? 'mui-btn-warning' : '' }}">{{ value }}</button>
                        {{ /each }}
                    </span>
                </li>
                <li class="mui-table-view-cell product-num">
                    数量: <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' data-numbox-max='100'>
                        <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
                        <input class="mui-numbox-input" type="number" />
                        <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
                    </div>
                    剩余: <span>{{ num }}</span>
                </li>
            </ul>
        </section>
    </script>
</body>

</html>